import { TableColumnObject } from 'amis/lib/renderers/Table'
import lodash from 'lodash'
import iamApplicationService from '@/core/account/service/iamApplicationService'
import serverColumnUtils, { ServerColumnUtilsProps } from '@/components/amis/ServerColumnUtils/serverColumnUtils'
import iamApplicationAdminService from '@/core/account/generated/service/admin/iamApplicationAdminService'

class IamAppIdColumnUtils {
	getSchema = (parmas?: Partial<ServerColumnUtilsProps>): TableColumnObject => {
		return serverColumnUtils.getSchema(
			lodash.merge(
				{
					name: 'iamAppId',
					label: '账户应用',
					valueField: 'id',
					labelField: 'title',
					getByIdsWithDebounce: iamApplicationAdminService.getByIdsWithDebounce,
				},
				parmas,
			),
		)
	}
}

export default new IamAppIdColumnUtils()
